<template>
<p>可以传入目标的各种类型的参数。 自<span class="vp-tag">2.5.2</span>以来支持字符串和函数类型。</p>
  <el-button type="primary" @click="openVar = true">Begin Tour</el-button>

  <el-divider />

  <el-space>
    <el-button id="btn1">Upload</el-button>
    <el-button id="btn2" type="primary">Save</el-button>
    <el-button ref="btnRefVar" :icon="MoreFilled" />
  </el-space>

  <el-tour v-model="openVar">
    <el-tour-step
      target="#btn1"
      title="Upload File"
      description="Put you files here."
    />
    <el-tour-step :target="el" title="Save" description="Save your changes" />
    <el-tour-step
      :target="btnRefVar?.$el"
      title="Other Actions"
      description="Click to see other"
    />
  </el-tour>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { MoreFilled } from '@element-plus/icons-vue'
import type { ButtonInstance } from 'element-plus'

const el = () => document.querySelector<HTMLElement>('#btn2')
const btnRefVar = ref<ButtonInstance>()

const openVar = ref(false)
</script>

<style scoped>
@import '../../assets/elementPlusDemo.css'
</style>